package com.sjtu.vfact.textual.util;

import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

import com.sjtu.vfact.textual.model.Document;

public class Generator {

	public static void fillSingleTermMap(Map<String, Set<Integer>> map, Document doc){
		int id = doc.getId();
		for(String term : doc.getTerms()){
			if(map.containsKey(term)){
				map.get(term).add(id);
			}else{
				Set<Integer> docIds = new LinkedHashSet<Integer>();
				docIds.add(id);
				map.put(term, docIds);
			}
		}
	}
	
}
